package lesson.myicharstream;

import java.io.*;
import java.lang.reflect.Array;
import java.util.Arrays;

public class BufferedTest {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("Day12\\src\\lesson\\myicharstream\\c.txt"));

        String line = br.readLine();
        String [] split = line.split(" ");
        int [] numArr = new int[split.length];
        for (int i = 0; i < split.length; i++) {
            numArr[i] = Integer.parseInt(split[i]);
        }

        Arrays.sort(numArr);
        System.out.println(Arrays.toString(numArr));

        BufferedWriter bw = new BufferedWriter(new FileWriter("Day12\\src\\lesson\\myicharstream\\e.txt"));
        for (int i : numArr) {
            bw.write(i + " ");
            bw.flush();
        }
        bw.close();
    }
}
